<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>服务企业列表</title>
		<link rel="stylesheet" href="https://www.77bi.vip/res/extjs6.0/classic/theme-crisp/resources/theme-crisp-all.css"></link>
		<script src="https://www.77bi.vip/res/extjs6.0/ext-all.js"></script>,
		<script src="https://www.77bi.vip/res/extjs6.0/classic/locale/locale-zh_CN.js"></script>
		<script src="TreePicker.js"></script>
		<script src="multitree.js"></script>
		<script type="text/javascript">
			var store = Ext.create('Ext.data.TreeStore', {
				root: {
					id:'',
					text:'',
					expanded: true,
					checked:false,
					children: [{
							id:'01',
							text: 'detention',
							checked:false,
							leaf: true
						},
						{
							id:'02',
							text: 'homework',
							checked:false,
							expanded: true,
							children: [{
									id:'03',
									text: 'book report',
									checked:false,
									leaf: true
								},
								{
									id:'04',
									text: 'algebra',
									checked:false,
									leaf: true
								}
							]
						},
						{
							id:'05',
							text: 'buy lottery tickets',
							checked:false,
							leaf: true
						}
					]
				},
				rootVisible:false,
			});
			var form_panel = Ext.create("Ext.form.Panel", {
				buttonAlign: "center",
				bodyStyle: "padding: 10px;",
				defaultType: "textfield",
				items: [{
					xtype: 'container',
					layout: 'hbox',
					items: [{
						xtype: 'treepicker',
						id: 'cmbfarther',
						name: 'FartherId',
						fieldLabel: '下拉树',
						editable: false,
						queryMode: 'remote',
						emptyText: '--请选择--',
						store: store,
						displayField: 'text',
						valueField: 'id',
						forceSelection: true,
						scrollable: true,
						minPickerHeight: 200,
						value: '' //这个定义很重要，如果没有设置或与store定义的rootid不一样，在提交时，如果这个下拉树没有选择，参数中将不包含FartherId
					}]
				},{
					xtype: 'container',
					layout: 'hbox',
					items: [{
						xtype: 'multitreepicker',
						id: 'multifarther',
						name: 'FartherId',
						fieldLabel: '下拉树多选',
						editable: false,
						queryMode: 'remote',
						emptyText: '--请选择--',
						store: store,
						displayField: 'text',
						valueField: 'id',
						forceSelection: true,
						scrollable: true,
						minPickerHeight: 200,
						value: '' ,
						selModel : {
						    selType : 'checkboxmodel',
						    mode : 'SIMPLE'
						}
					}]
				}],
			});
			Ext.onReady(function() {
				form_panel.render(Ext.getBody());
			});
		</script>
	</head>

	<body>
	</body>

</html>